package com.zry.traced.ui.activity

import com.zry.traced.R
import com.zry.traced.animation.RecyclerViewUtilKt
import com.zry.traced.been.OperationRecordBean
import com.zry.traced.databinding.ActivityOperationRecordBinding
import com.zry.traced.presenter.OperationRecordPresenter
import com.zry.traced.ui.base.BaseActivity
import kotlinx.android.synthetic.main.activity_operation_record.*
import kotlinx.android.synthetic.main.activity_store_order_list.*
import kotlinx.android.synthetic.main.common_title.*

class OperationRecordActivity : BaseActivity() {
    private var operationRecordBinding: ActivityOperationRecordBinding? = null
    private var operationRecordPresenter: OperationRecordPresenter? = null
    var title = ""
    private var operationRecordBeanList: MutableList<OperationRecordBean>? = null
    override fun getLayoutId(): Int {
        return R.layout.activity_operation_record
    }

    override fun initData() {

        title = intent.getStringExtra("title")
        titleCenterText.text = title
        commonLeftLinearLayout.setOnClickListener { finish() }

        operationRecordBinding = viewDataBinding as ActivityOperationRecordBinding
        operationRecordPresenter = OperationRecordPresenter(this)
        operationRecordBeanList = mutableListOf()
        initView()
        operationRecordPresenter?.getOperationRecord()

    }

    private fun initView() {
        recyclerViewUtilKt = RecyclerViewUtilKt(this, operationRecordRecycler)
        recyclerViewUtilKt?.initRecyclerView()

        operationRecordRecycler.useDefaultLoadMore() // 使用默认的加载更多的View。
        operationRecordRecycler.setLoadMoreListener(operationRecordPresenter?.mLoadMoreListener) // 加载更多的监听。
    }

}
